<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title></title>
    <link href="/styles/base.css" rel="stylesheet" type="text/css">
    <link href="/styles/flight.css" rel="stylesheet" type="text/css">
    <link href="/js/plugins/jqPaginator/jqPagination.css" rel="stylesheet" type="text/css">
    <link href="/styles/flight/css+hotel+datepicker-range^a1w^1552035728.css" rel="stylesheet" type="text/css">
    <link href="/styles/flight/css+mfw-header.2015^ylvs^1559526017.css" rel="stylesheet" type="text/css">
    <link href="/styles/flight/mfw-footer.css" rel="stylesheet" type="text/css">
    <link href="/styles/flight/mfw-toolbar.css" rel="stylesheet" type="text/css">

    <script type="text/javascript" src="/js/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="/js/plugins/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="/js/plugins/jquery-form/jquery.form.js"></script>
    <script type="text/javascript" src="/js/plugins/jqPaginator/jq-paginator.min.js"></script>
    <script type="text/javascript" src="/js/system/index.js"></script>
    <script type="text/javascript" src="/js/plugins/jrender/jrender.min.js"></script>
    <style>
        .arrow {
            width: 78px;
            height: 7px;
            margin-top: 15px;
            display: inline-block;
            background: url('/images/flight/sprites4.png') -50px -150px no-repeat;
            background-size: auto;
            vertical-align: middle;
        }

        .btn_search > a {
            display: block;
            background-color: #ff9d00;

            color: #fff;
            font-size: 18px;
            position: absolute;
            right: 50;
            right: 50px;
            padding: 10px 20px;
            border-radius: 5px;
        }
    </style>
</head>

<body>
    <#list tickets as t>
        <div id="airinfo">
            <div id="flight_list" style="" >
                <div class="f-list ng-scope" ng-repeat="one in result.flights|orderBy:sort.key:sort.type" ng-if="loaded">
                    <div class="f-item" ng-attr-id="{{ 'airline-item-' + one.flight_no }}" ng-click="showSubInfo(one)"
                         id="airline-item-9C8542">
                        <div class="f-item-info ng-scope" ng-if="one.flight_no" style="position: relative">
                            <div class="f-line">
                                <span class="airline-logo"><i ng-attr-id="{{ 'logo-item-' + one.flight_no }}"
                                                              id="logo-item-9C8930" class="airline-logo-9C"></i></span>
                                <p class="f-name ng-binding">${t.name}<span class="ng-binding"></span>
                                </p>
                                <p class="sub ng-binding">${t.flightNo}</p>
                            </div>
                            <div class="f-time">
                                <div class="time ng-binding" ng-bind="one.dep_time"
                                     render-fun="beginFly">${t.depTime?string('HH:mm')}
                                </div>
                                <p class="sub ng-binding" >${t.depPort}</p>
                            </div>
                            <div class="through">
                                <div class="arrow"></div>
                                <p class="duration ng-binding" ng-bind="one.takingTime"></p>
                                <div class="f-pop f-pop-stay">
                                    <i class="pop-arrow"></i>
                                    <strong>经停</strong>
                                    <p>经停城市：<span ng-bind="one.stop_infos.city_name" class="ng-binding"></span></p>
                                </div>
                            </div>
                            <div class="f-time">
                                <div class="time ng-binding" ng-bind="one.arr_time">${t.arrTime?string('HH:mm')}
                                </div>
                                <p class="sub ng-binding">${t.arrPort}</p>
                            </div>
                            <div class="item item-btn btn_search">
                                <a id="btn_search" class="order_flight" data-fid="${t.id}">订购</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </#list>
</div>
    <script>
        $(function () {
            /*订票机票点击事件*/
            $(".order_flight").on("click", function () {
                var r = confirm("确认是否订购该机票？");
                if (r == true) {
                    var fid = $(this).data("fid");
                    $.get("/flight/order",{fid:fid},function (data) {
                        if(data.success){
                            alert("预订成功!");
                        }else{
                            alert(data.msg);
                        }
                    });
                } else {
                    alert("取消预订!");
                }
            })
        });
    </script>
</body>

</html>